package com.zhang.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;

@Api(tags = "日志实体类")
@Data
@NoArgsConstructor
@TableName(value = "t_log")
public class LogBean {
    @ApiModelProperty("日志id")
    @TableId(value = "pk_logId",type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("日志记录时间")
    @TableField(value = "l_time")
    private LocalDate time = LocalDate.now();

    @ApiModelProperty("日志内容")
    @TableField(value = "l_content")
    private String content;

    public LogBean(String content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "LogBean{" +
                "id=" + id +
                ", time='" + time + '\'' +
                ", content='" + content + '\'' +
                '}' + "\n";
    }
}
